package com.zy.studentSide.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zy.studentSide.entity.Student;
import com.zy.studentSide.entity.StudentInformation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

/**
 * @author 29787
 */
@Mapper
@Component
public interface StudentInformationDao extends BaseMapper<StudentInformation> {

    /**
     * 根据学生id查重
     * @param studentNum
     * @return StudentInformation
     */
    @Select("select * from hms_student_information where student_num=#{studentNum}")
    StudentInformation getStudentInformationByStudentNum(String studentNum);

    /**
     * 根据学生num，教师id查询信息
     * @param studentNum
     * @param teacherId
     * @return StudentInformation
     */
    @Select("select * from hms_student_information where student_num=#{studentNum} and teacher_id=#{teacherId}")
    StudentInformation getStudentInformationByTeacherId(String studentNum, Integer teacherId);

}
